﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Net_SCADA.Forms;
using Net_SCADA.Siemens;

namespace Net_SCADA
{
    public partial class Form_Settings : fdBaseForm
    {


        public Form_Settings()
        {
            InitializeComponent();
        }

        private void Form_Settings_Load(object sender , EventArgs e)
        {
            netForms.SetPostionAndSize(this);
            cmbLanguageSelect.Items.AddRange(MultipleLanguage.systemLanguageName.ToArray()); 
            cmbLanguageSelect.SelectedIndex = MultipleLanguage.systemLanguageIndex;
            this.cmbLanguageSelect.SelectedIndexChanged += new System.EventHandler(this.cmbLanguageSelect_SelectedIndexChanged);
        }

        private void btn_AlarmLevelColorSet_Click(object sender , EventArgs e)
        {
            Form_AlarmLevelColorSet fm=new Form_AlarmLevelColorSet();
            fm.ShowDialog();
        }

        private void btn_AlarmLevelSet_Click(object sender , EventArgs e)
        {
            Form_AlarmLevelSet fm=new Form_AlarmLevelSet();
            fm.ShowDialog();
        }

        private void btn_UserManage_Click(object sender , EventArgs e)
        {
            Form_UserSet fm=new Form_UserSet();
            fm.ShowDialog();
        }

        private void cmbLanguageSelect_SelectedIndexChanged(object sender, EventArgs e)
        {
            //在切换的时候，需要对 form_top 和 form_setting进行语言的切换
            MultipleLanguage.systemLanguageIndex = cmbLanguageSelect.SelectedIndex;
            MultipleLanguage.switchLanguage();
        }
    }
}
